﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Infrastructure.Pluralization.Interfaces;

namespace Infrastructure.Pluralization
{
    /// <remarks>Parameterized Factory Method pattern</remarks>
    public class EventWordPluralizationFactory
    {
        public virtual IEventWordPluralizationStrategy GetPluralizationStrategy(CultureInfo cultureInfo)
        {
            string language = cultureInfo.TwoLetterISOLanguageName;

            switch (language)
            {
                case "en": return new EventWordEnglishPluralization();
                case "ru":
                        return new EventWordRussianPluralization();
                default:
                        throw new ArgumentException("Specified value of cultureInfo parameter is not supported");
            }
        }
    }
}
